import request from '@/utils/request'

// 查询违规词汇列表
export function listWords(query) {
  return request({
    url: '/violate/words/list',
    method: 'get',
    params: query
  })
}

// 查询违规词汇详细
export function getWords(id) {
  return request({
    url: '/violate/words/' + id,
    method: 'get'
  })
}

// 新增违规词汇
export function addWords(data) {
  return request({
    url: '/violate/words',
    method: 'post',
    data: data
  })
}

// 导入违规词汇
export function importWords(data) {
  return request({
    url: '/violate/words/import',
    method: 'post',
    data: data
  })
}

// 修改违规词汇
export function updateWords(data) {
  return request({
    url: '/violate/words',
    method: 'put',
    data: data
  })
}

// 删除违规词汇
export function delWords(id) {
  return request({
    url: '/violate/words/' + id,
    method: 'delete'
  })
}

// 一键去重
export function fundistinct() {
  return request({
    url: '/violate/words/distinct',
    method: 'get',
  })
}
